Page History: Connecting the API
Compare Page Revisions
Page Revision: 2012/01/21 17:42
To access the API from your application you need to add a reference to the T4API.20.dll and T4Definitions.20.dll files located in the c:\Program Files\CTS\T4ClientSim\bin\ folder to your project.
The namespace that contains all the API objects is T4.API. Most enumerations are defined in the T4 namespace:
In order for your application to connect and login to the system you must create and hold a reference to a T4.API.Host object. Connection status and login responses are raised as events from this host object.
' Reference to the main api host object.
Private WithEvents moAPI As Host
To connect to the system you simply create the Host object:
' Initialise the api when the application starts.
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Create the api host object.
moAPI = New Host("", _
Host.ServerType.Simulator, _
"T4Example", _
"112A04B0-5AAF-42F4-994E-FA7CB959C60B", _
"cfc", _
"T4Example", _
"t4example")
End Sub